package com.example.hotelrear.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.hotelrear.entity.User;
import com.example.hotelrear.mapper.UserMapper;
import com.example.hotelrear.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author FengXiao
 * @since 2023-08-28
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public User login(User user) {;
        return userMapper.login(user);
    }

    @Override
    public User regexUsername(String username) {
        return userMapper.regexUsername(username);
    }

    @Override
    public User regexPhone(String phone) {
        return userMapper.regexPhone(phone);
    }


    @Override
    public boolean regist(User user) {
        return userMapper.regist(user)!=0;
    }
    @Override
    public boolean updateUser(User user) {
        return userMapper.updateUser(user)!=0;
    }


}
